<div class="data-div" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary">数据列表</span>
        <form  role="form" onsubmit="return false;" id="form_data_table_goods_order_list_1">
            <div class="widget-buttons">
                支付状态：<select name="orderStatus" id="orderStatus"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="0">--未支付--</option>
                            <option value="1">--已支付--</option>
                         </select>
                订单ID：<input type="text" name="orderId" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
                商品名称：<input type="text" name="goodsTitle" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
                用户：<input type="text" name="userName" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
            </div>
            <div class="widget-buttons">
                <button href="javascript:;" class="btn btn-blue btn-xs search"  data-title="查询" data-form="true" onclick="">查询</button>
            </div>

        </form>
    </div>

    <div class="widget no-header ">
        <div class="widget-body">
            <table class="table table-condensed table-bordered table-hover " id="data_table_goods_order_list_1">
            </table>

        </div>
    </div>
    <!-- END SAMPLE TABLE PORTLET-->
</div>

<script type="text/javascript">

    $(document).ready(function() {

        //look-up 查询条件 会员
        Select2Ex.handleForm4select2({target:$("#form_data_table_goods_order_list_1")});

        TableAjax.init('data_table_goods_order_list_1',{
            sAjaxSource: "goods/order/list",
            aaSorting: [ [0, "asc" ] ], // 需要自定义
            uxDataTitle:"null",
            uxCheckable:false,
            uxCloseScroll:true,
            uxDrapable:false,
            aoColumns: [
                {sTitle:'订单ID',  mData: "id",uxLongText:true},
                {sTitle:'商品名称',  mData: "goodsInfo.title"},
                {sTitle:'出库状态',  mData: "exWarehouse",
                    mRender:function(data,d,all){
                        if (all.exWarehouse==0){
                            return "<font color='red'>未出库</font>";
                        }else if (all.exWarehouse==1||all.exWarehouse==null){
                            return "<font color='green'>已出库</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'发货状态',  mData: "sendOut",
                    mRender:function(data,d,all){
                        if (all.sendOut==0){
                            return "<font color='red'>未发货</font>";
                        }else if (all.sendOut==1||all.sendOut==null){
                            return "<font color='green'>已发货</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'用户',  mData: "buyUser.userName"},
                {sTitle:'用户昵称',  mData: "buyUser.nickName"},
                {sTitle:'单价（元）',  mData: "orderPrice",
                    mRender:function (all,d,all) {
                        return (all.orderPrice/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                    }
                },
                {sTitle:'购买数量',  mData: "buyNum"},
                {sTitle:'总价（元）',  mData: "totalAmount",
                    mRender:function (all,d,all) {
                        return (all.totalAmount/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                    }
                },
                {sTitle:'支付方式',  mData: "channel",mRender:function(data,d,all){
                    if(all.channel=='alipay'){
                        return "支付宝";
                    }else if(all.channel=='wx'){
                        return "微信支付";
                    }else{
                        return "其它方式";
                    }
                }},
                {sTitle:'支付状态',  mData: "orderStatus",
                    mRender:function(data,d,all){
                        if (all.orderStatus==0){
                            return "<font color='red'>未支付</font>";
                        }else if (all.orderStatus==1){
                            return "<font color='green'>已支付</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'创建时间',  mData: "insertTime",
                    mRender:function (all,d,all) {
                        return all.insertTimeStr;
                    }
                },
                {
                    sTitle: '操作', mData: "id", mRender: function (data, d, all) {
                        var htm = '';
                        htm += '<a class="blue-stripes" style="margin:15px" data-title="收件人信息" data-handler="MODAL" href="goods/order/addressee_page?id='+all.id+'" modal-size="820px">收件人</a>';
                        htm += '<a style="margin:20px" data-handler="CONFIRM"  href="goods/order/ex_warehouse?id=' + all.id + '">出库</a>';
                        htm += '<a style="margin:20px" data-handler="CONFIRM"  href="goods/order/send_out?id=' + all.id + '">发货</a>';
                        return htm;
                    }
                }
            ]

        });

    });

</script>